package com.hsy.crm.web.web.system;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.Company;
import com.hsy.crm.web.domain.vo.company.CompanyPageVo;
import com.hsy.crm.web.service.impl.CompanyService;
import com.hsy.crm.web.web.BaseAction;
import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.Company;
import com.hsy.crm.web.domain.vo.company.CompanyPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/company")
public class CompanyAction extends BaseAction {

    @Autowired
    CompanyService companyService;

    @RequestMapping("/insert")
    public String insert(Company company) {
        return Response.body(companyService.insertCompany(company));
    }

    @RequestMapping("/update")
    public String update(Company company) {
        return Response.body(companyService.updateCompany(company));
    }

    @RequestMapping("/delete")
    public String delete(Company company) {
        return Response.body(companyService.deleteCompany(company));
    }

    @RequestMapping("/find")
    public String find(CompanyPageVo companyPageVo) {
        return Response.body(companyService.find(companyPageVo));
    }

}
